<style lang="less">

</style>
<template>
  <div  style="position: relative;">
    <mmTable :mmColumns="columns" ref="mmTable" :getUrl="url" :updateUrl="updateUrl" :delUrl="delUrl"
             :form="form" :formData="formData" v-on:formDataChange="formDataChange"
             :searchFormData="searchFormData" :searchForm="searchForm"
             :modalWidth="700"
    >
      <Form slot="searchForm" ref="searchForm" :model="searchFormData" inline :label-width="70"  style="float: left">
        <FormItem label="用户名" prop="">
          <Input v-model="searchFormData.name" type="text" placeholder="" />
        </FormItem>
      </Form>
      <Form  slot="editForm" :label-width="150" :model="formData" inline ref="editForm" :rules="formValidate">
        <Row>
          <Col :span="24">
          <FormItem label="编号" prop="code" style="width:500px">
            <Input v-model="formData.code" type="text"  />
          </FormItem>
          </Col>
        </Row>
        <Row>
          <Col :span="24">
          <FormItem label="名称" prop="name" style="width:500px">
            <Input v-model="formData.name" type="text"  />
          </FormItem>
          </Col>
        </Row>
        <Row>
          <Col :span="24">
          <FormItem label="权限" prop="mname" style="width:500px">
            <Input v-model="formData.mname" type="text"  />
          </FormItem>
          </Col>
        </Row>
        <Row>
          <Col :span="24">
          <FormItem label="备注" prop="memo" style="width:500px">
            <Input v-model="formData.memo" type="textarea" height="200"/>
          </FormItem>
          </Col>
        </Row>
      </Form>

    </mmTable>
  </div>
</template>

<script>
  import mmTable from '../components/mmtable/mmtable.vue';
  export default {
    components: {
      mmTable
    },
    data () {
      return {
        url:'/module/getList',
        updateUrl:'/module/Save',
        delUrl:'/module/Delete',
        columns:[
          {title: "编号",key: "code",width:200,align:'center'},
          {title: "名称",key: "name",width:150,align:'center'},
          {title: "权限",key: "mname",width:150,align:'center'},
          {title: "备注",key: "memo",align:'left'}
        ],
        formData:{
          code:'',
          name:'',
          mname:'',
          mid:'',
          memo:''
        },
        form:{},
        formValidate:{
        },
        searchForm:{},
        searchFormData:{
          code:'',
          name:''
        }
      };
    },
    mounted () {
      this.form = this.$refs.editForm;
      this.searchForm = this.$refs.searchForm;
    },
    methods: {
      formDataChange(data) {
        this.formData = data;
      }
    }
  };
</script>
